/**
 * @file       EditField.h
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Jan 12, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef EDITFIELD_H_
#define EDITFIELD_H_
#include "Frame.h"
#include "PageInfo.h"
#include "PagingByEditFieldStrategy.h"

namespace NS_LCD_AFW
{

class CChar;
class CFrame;

class CEditField: public CFrame
{
public:
	CEditField();

protected:
	virtual ~CEditField();

public:
	virtual int setText(std::string text);
	virtual std::string getText() const;
	virtual int addChar(CChar *pChar);
protected:
	void release();

protected:
	virtual int onDraw(IDisplay *pDisplay);
	virtual void onSetFocus();
	virtual void onLostFocus();
	virtual void onHightlight();
	virtual void onUnHightlight();
	virtual void onSize(const CRect &oldRect, const CRect &newRect);

private:
	virtual int onRightKeyPress();
	virtual int onLeftKeyPress();
	virtual int onUpKeyPress();
	virtual int onDownKeyPress();
	virtual int onEnterKeyPress();
	virtual int onEscKeyPress();

private:
	CFramePtrArray m_charPtrArray;
	CPageInfo m_pageResult;
	CPagingByEditFieldStrategy m_pageingStrategy;

private:
	DISABLE_COPY_CONSTRUCTOR_AND_ASSIGN_REFERENCE(CEditField);
};

} /* namespace NS_LCD_AFW */
#endif /* EDITFIELD_H_ */
